//
//  ExceptionView.h
//  bestkeep
//
//  Created by 毛韶谦 on 2016/12/15.
//  Copyright © 2016年 utouu. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSInteger, ExceptionCodeType){
    ExceptionCodeTypeEmptyPages = 0,        //空界面
    ExceptionCodeTypeServerError,           //服务器错误
    ExceptionCodeTypeRequestFailed,         //请求失败
    ExceptionCodeTypeFailedToLoad,          //加载失败
    ExceptionCodeTypeNoData,                //没有数据
    ExceptionCodeTypeNoNetwork,             //无网络
    ExceptionCodeTypeSearchIsEmpty          //搜索为空
};


@interface ExceptionViewAction : NSObject

@property(nonatomic,strong,readonly) NSString *title __attribute__((deprecated("title已被弃用")));
@property(nonatomic,assign,readonly) ExceptionCodeType type;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

// 该方法title设置无效，默认type为ExceptionCodeTypeEmptyPages
+(instancetype)actionWithTitle:(NSString*)title handler:(void(^)(ExceptionViewAction *action))handler __attribute__((deprecated("该方法title设置无效，请使用'actionWithType:handler:'方法")));

+(instancetype)actionWithType:(ExceptionCodeType)type handler:(void(^)(ExceptionViewAction *action))handler;

@end




@interface ExceptionView : UIView

@property(nonatomic,strong,readonly) NSString *title __attribute__((deprecated("title已被弃用")));
@property(nonatomic,assign,readonly) ExceptionCodeType type;

-(void)addAction:(ExceptionViewAction*)action;
-(void)showInView:(UIView*)view;
-(void)dismiss;

- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

// 该方法title设置无效，默认type为ExceptionCodeTypeEmptyPages
+(instancetype)exceptionViewWithTitle:(NSString*)title __attribute__((deprecated("该方法title设置无效，请使用'exceptionViewWithType:'方法")));

+(instancetype)exceptionViewWithType:(ExceptionCodeType)type;

+(instancetype)exceptionViewWithType:(ExceptionCodeType)type controller:(UIViewController*)controller;

@property(nonatomic,strong) UILabel *titleLabel;
@property(nonatomic,strong) UILabel *contentLabel;


@end
